<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Briscola:  File sorgente struttura_dati.h</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Briscola
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generato da Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Cerca');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Pagina&#160;Principale</span></a></li>
      <li><a href="annotated.html"><span>Classi</span></a></li>
      <li class="current"><a href="files.html"><span>File</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Cerca" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>Elenco&#160;dei&#160;file</span></a></li>
      <li><a href="globals.html"><span>Elementi&#160;dei&#160;file</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">struttura_dati.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="struttura__dati_8h.html">Vai alla documentazione di questo file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#include &lt;iostream&gt;</span>
<a name="l00002"></a>00002 <span class="preprocessor">#include &lt;fstream&gt;</span>
<a name="l00003"></a>00003 
<a name="l00004"></a>00004 <span class="keyword">using namespace </span>std;
<a name="l00005"></a>00005 
<a name="l00006"></a>00006 <span class="preprocessor">#ifdef DEBUG_MODE</span>
<a name="l00007"></a>00007 <span class="preprocessor"></span><span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> MASCHERA = 3;
<a name="l00008"></a>00008 
<a name="l00009"></a>00009 <span class="comment">// debug che permete di vedere le carte dell&#39;avversario</span>
<a name="l00010"></a>00010 <span class="preprocessor">#define ALTERNATIVE</span>
<a name="l00011"></a>00011 <span class="preprocessor"></span>
<a name="l00012"></a>00012 <span class="preprocessor">#define  DBG(A, B) {if((A) &amp; MASCHERA) { B; } }</span>
<a name="l00013"></a>00013 <span class="preprocessor"></span>
<a name="l00014"></a>00014 <span class="preprocessor">#else</span>
<a name="l00015"></a><a class="code" href="struttura__dati_8h.html#a9fd176efd6d22cb809550f0271c2a93d">00015</a> <span class="preprocessor"></span><span class="preprocessor">#define DBG(A, B)</span>
<a name="l00016"></a>00016 <span class="preprocessor"></span>
<a name="l00017"></a>00017 <span class="preprocessor">#endif</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span>
<a name="l00019"></a><a class="code" href="struttura__dati_8h.html#a330bea9b36f638349fec0d06c8ab4c38">00019</a> <span class="preprocessor">#define D1(a) DBG(1, a)</span>
<a name="l00020"></a><a class="code" href="struttura__dati_8h.html#a975397c373ae2a9dc28d0297fa18da56">00020</a> <span class="preprocessor"></span><span class="preprocessor">#define D2(a) DBG(2, a)</span>
<a name="l00021"></a>00021 <span class="preprocessor"></span>
<a name="l00022"></a>00022 
<a name="l00023"></a>00023 
<a name="l00024"></a>00024 
<a name="l00025"></a>00025 <span class="comment">/* Struttura dati */</span>
<a name="l00026"></a>00026 
<a name="l00029"></a><a class="code" href="struttura__dati_8h.html#a5dbc4352c68c9e6a9f7cc39954afa494">00029</a> <span class="keyword">const</span> <span class="keywordtype">char</span> <a class="code" href="struttura__dati_8h.html#a5dbc4352c68c9e6a9f7cc39954afa494" title="Nome del file che contiene tutti i nomi delle immagini delle carte.">NOME_FILE</a>[] = <span class="stringliteral">&quot;nomi_carte.txt&quot;</span>;
<a name="l00030"></a>00030 
<a name="l00033"></a><a class="code" href="struttura__dati_8h.html#a6dc47b7303feb3f7d04c3f92d4a3d3f8">00033</a> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="struttura__dati_8h.html#a6dc47b7303feb3f7d04c3f92d4a3d3f8" title="Lunghezza del nome memorizzato nel NOME_FILE, ovvero del nome delle immagini.">MAX_LUN_RIGA1</a> = 7;
<a name="l00034"></a>00034 
<a name="l00037"></a><a class="code" href="struttura__dati_8h.html#ae01251db7dbecc7ec5933a8c2421aeac">00037</a> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="struttura__dati_8h.html#ae01251db7dbecc7ec5933a8c2421aeac" title="Lunghezza del nome del file immagine completo, contiene il percorso relativo.">MAX_LUN_RIGA2</a> = 16;
<a name="l00038"></a>00038 
<a name="l00041"></a><a class="code" href="struttura__dati_8h.html#abd27055a620a778f45dd55b7e285fdfd">00041</a> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="struttura__dati_8h.html#abd27055a620a778f45dd55b7e285fdfd" title="Numero di carte che compone il mazzo.">NUM_CARTE</a> = 40;
<a name="l00042"></a>00042 
<a name="l00045"></a><a class="code" href="struttura__dati_8h.html#a85d04f447605ad1eb3ff261c8482339f">00045</a> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="struttura__dati_8h.html#a85d04f447605ad1eb3ff261c8482339f" title="Numero di carte che compondono la mano di gioco.">NUM_MANO</a> = 3;
<a name="l00046"></a>00046 
<a name="l00049"></a><a class="code" href="struttura__dati_8h.html#a56c71d9d33be85d26b867817dcd855b8">00049</a> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="struttura__dati_8h.html#a56c71d9d33be85d26b867817dcd855b8" title="Vettore che contiene i pesi delle rispettive carte: i punteggi.">PESI</a>[10]={11,0,10,0,0,0,0,2,3,4};
<a name="l00050"></a>00050 
<a name="l00054"></a><a class="code" href="struttura__dati_8h.html#a45a8d009f7ea3044c9fa266b39fc0ed2">00054</a> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="struttura__dati_8h.html#a45a8d009f7ea3044c9fa266b39fc0ed2" title="Vettore che contiene le precedenze per valore.">PREC</a>[10]={0,9,1,8,7,6,5,4,3,2};
<a name="l00055"></a>00055 
<a name="l00056"></a>00056 
<a name="l00066"></a><a class="code" href="structcarta__t.html">00066</a> <span class="keyword">struct </span><a class="code" href="structcarta__t.html" title="Struttura che rappresenta la mia carta.">carta_t</a>{
<a name="l00067"></a><a class="code" href="structcarta__t.html#a3923d5d027000fdd435b700fdd7d3d25">00067</a>         <span class="keywordtype">int</span> <a class="code" href="structcarta__t.html#a3923d5d027000fdd435b700fdd7d3d25">val</a>;
<a name="l00068"></a><a class="code" href="structcarta__t.html#a09863517b95595e3e5a1ce921f1b3c0f">00068</a>         <span class="keywordtype">char</span> nome[<a class="code" href="struttura__dati_8h.html#ae01251db7dbecc7ec5933a8c2421aeac" title="Lunghezza del nome del file immagine completo, contiene il percorso relativo.">MAX_LUN_RIGA2</a>];
<a name="l00069"></a><a class="code" href="structcarta__t.html#a86abba56ea536cc662db44012fafd7cf">00069</a>         <span class="keywordtype">bool</span> <a class="code" href="structcarta__t.html#a86abba56ea536cc662db44012fafd7cf">selez</a>;
<a name="l00070"></a><a class="code" href="structcarta__t.html#a6ab59c1cf13af80185c74545bc8f1443">00070</a>         <span class="keywordtype">bool</span> <a class="code" href="structcarta__t.html#a6ab59c1cf13af80185c74545bc8f1443">esiste</a>;
<a name="l00071"></a>00071         };
<a name="l00072"></a>00072 
<a name="l00075"></a><a class="code" href="struttura__dati_8h.html#a8a71203dddb4c72aa8ff0e4e0cd1047faeafcea87a64a504a883de9ab41629ec1">00075</a> <span class="keyword">enum</span> <a class="code" href="struttura__dati_8h.html#a8a71203dddb4c72aa8ff0e4e0cd1047f" title="Tipo enum che indica quale giocatore sta giocando.">gioca_t</a> {<a class="code" href="struttura__dati_8h.html#a8a71203dddb4c72aa8ff0e4e0cd1047faeafcea87a64a504a883de9ab41629ec1">giocatore</a>, <a class="code" href="struttura__dati_8h.html#a8a71203dddb4c72aa8ff0e4e0cd1047faf6d8af4c51e534d5cfd2062acf2c692c">computer</a>};
<a name="l00076"></a>00076 
<a name="l00077"></a>00077 
<a name="l00080"></a><a class="code" href="struttura__dati_8h.html#af16526149e58b386d1e509ab86b84ba3">00080</a> <span class="keyword">enum</span> <a class="code" href="struttura__dati_8h.html#af16526149e58b386d1e509ab86b84ba3" title="Tipo enum che mi dice chi gioca per primo, e quindi chi pesca.">turno_t</a> {<a class="code" href="struttura__dati_8h.html#af16526149e58b386d1e509ab86b84ba3a711e3d3b88e96ae8ff6eb4a4250b4990">primo</a>, <a class="code" href="struttura__dati_8h.html#af16526149e58b386d1e509ab86b84ba3a935b42c525c5efab6e8bbd833c889c3f">secondo</a>}; 
<a name="l00081"></a>00081 
<a name="l00082"></a>00082 
<a name="l00087"></a><a class="code" href="struttura__dati_8h.html#a6c22c9841db8736b39bf263fef57ea00aed5e1b554d8a8c57ad81b1e7d6278cc2">00087</a> <span class="keyword">enum</span> <a class="code" href="struttura__dati_8h.html#a6c22c9841db8736b39bf263fef57ea00" title="Tipo enum che definisce la priorità di una carta.">prior_carta_t</a> {<a class="code" href="struttura__dati_8h.html#a6c22c9841db8736b39bf263fef57ea00a24c06839e7b27a961fbbf3b63e3124d7">brisc</a>, <a class="code" href="struttura__dati_8h.html#a6c22c9841db8736b39bf263fef57ea00aa4500e61db092c2e1719b5d68b047ec3">first</a>, <a class="code" href="struttura__dati_8h.html#a6c22c9841db8736b39bf263fef57ea00aed5e1b554d8a8c57ad81b1e7d6278cc2">second</a>};
<a name="l00088"></a>00088 
<a name="l00089"></a>00089 
<a name="l00095"></a><a class="code" href="structgiocatore__t.html">00095</a> <span class="keyword">struct </span><a class="code" href="structgiocatore__t.html" title="Struttura che rappresenta entrambi i giocatori.">giocatore_t</a>{
<a name="l00096"></a><a class="code" href="structgiocatore__t.html#aa8c2de59c223c0a184b443927681bb6e">00096</a>         <a class="code" href="structcarta__t.html" title="Struttura che rappresenta la mia carta.">carta_t</a> mano[<a class="code" href="struttura__dati_8h.html#a85d04f447605ad1eb3ff261c8482339f" title="Numero di carte che compondono la mano di gioco.">NUM_MANO</a>];
<a name="l00097"></a><a class="code" href="structgiocatore__t.html#a4a49b7d13900fd5914b3f3bd5b88a88b">00097</a>         <span class="keywordtype">int</span> <a class="code" href="structgiocatore__t.html#a4a49b7d13900fd5914b3f3bd5b88a88b">punteggio</a>;
<a name="l00098"></a>00098         };
<a name="l00099"></a>00099 
<a name="l00100"></a>00100 
<a name="l00109"></a><a class="code" href="structpartita__t.html">00109</a> <span class="keyword">struct </span><a class="code" href="structpartita__t.html" title="Struttura che rappresenta il mio gioco.">partita_t</a>{
<a name="l00110"></a><a class="code" href="structpartita__t.html#aae615050b87201d5c220657624553bd4">00110</a>         <a class="code" href="structcarta__t.html" title="Struttura che rappresenta la mia carta.">carta_t</a> mazzo[<a class="code" href="struttura__dati_8h.html#abd27055a620a778f45dd55b7e285fdfd" title="Numero di carte che compone il mazzo.">NUM_CARTE</a>];
<a name="l00111"></a><a class="code" href="structpartita__t.html#a22d2b36b0114a4fec3fb2c941debc37b">00111</a>         <span class="keywordtype">int</span> <a class="code" href="structpartita__t.html#a22d2b36b0114a4fec3fb2c941debc37b">idx</a>;
<a name="l00112"></a><a class="code" href="structpartita__t.html#a8f0135e2c32b08eeee0e4f56d0060303">00112</a>         <a class="code" href="structgiocatore__t.html" title="Struttura che rappresenta entrambi i giocatori.">giocatore_t</a> <a class="code" href="structpartita__t.html#a8f0135e2c32b08eeee0e4f56d0060303">player1</a>;
<a name="l00113"></a><a class="code" href="structpartita__t.html#a09b1c5d5095e341f598d1fda66cf4f20">00113</a>         <a class="code" href="structgiocatore__t.html" title="Struttura che rappresenta entrambi i giocatori.">giocatore_t</a> <a class="code" href="structpartita__t.html#a09b1c5d5095e341f598d1fda66cf4f20">player2</a>;
<a name="l00114"></a><a class="code" href="structpartita__t.html#a59cd27a5b3c0d18b137044ad81dfe5c9">00114</a>         <span class="keywordtype">int</span> <a class="code" href="structpartita__t.html#a59cd27a5b3c0d18b137044ad81dfe5c9">id_fine</a>;
<a name="l00115"></a>00115 };
</pre></div></div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>Tutto</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classi</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>File</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Funzioni</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variabili</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Tipi enumerati (enum)</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Valori del tipo enumerato</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Definizioni</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generato Lun 16 Giu 2014 12:47:59 per Briscola da &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
